package com.chenyongjing.design.pattern.singleton.register;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 容器式单例
 */
public class ContainerSingletonTest {
    public static void main(String[] args) {
        Object instance = ContainerSingleton.getInstance("com.chenyongjing.design.pattern.singleton.register.Pojo");
        Object instance2 = ContainerSingleton.getInstance("com.chenyongjing.design.pattern.singleton.register.Pojo");
        System.out.println(instance==instance2);

    }
}
